package com.xueyi.system.productionManager.manager.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xueyi.system.api.authority.domain.dto.SysMenuDto;
import com.xueyi.system.api.authority.domain.po.SysMenuPo;
import com.xueyi.system.productionManager.domain.query.BaseProductionManagerQuery;
import com.xueyi.system.productionManager.domain.dto.BaseProductionManagerDto;
import com.xueyi.system.productionManager.domain.po.BaseProductionManagerPo;
import com.xueyi.system.productionManager.domain.model.BaseProductionManagerConverter;
import com.xueyi.system.productionManager.mapper.BaseProductionManagerMapper;
import com.xueyi.common.web.entity.manager.impl.BaseManager;
import com.xueyi.system.productionManager.manager.IBaseProductionManagerManager;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 生产管理管理 数据封装层处理
 *
 * @author zlf
 */
@Component
public class BaseProductionManagerManager extends BaseManager<BaseProductionManagerQuery, BaseProductionManagerDto, BaseProductionManagerPo, BaseProductionManagerMapper, BaseProductionManagerConverter> implements IBaseProductionManagerManager {
    @Override
    public List<BaseProductionManagerDto> findByList(String plantId) {
        List<BaseProductionManagerPo> findByList = baseMapper.selectList(
                Wrappers.<BaseProductionManagerPo>query().lambda()
                        .eq(BaseProductionManagerPo::getPlantId,plantId));
        return baseConverter.mapperDto(findByList);
    }

    @Override
    public List<BaseProductionManagerDto> findMothByList(String month) {
        List<BaseProductionManagerPo> findByList = baseMapper.selectList(
                Wrappers.<BaseProductionManagerPo>query().lambda()
                        .like(BaseProductionManagerPo::getAgricultureTime,month));
        return baseConverter.mapperDto(findByList);
    }
}
